package com.itheima.reggie.mapper;

import com.itheima.reggie.entity.Employee;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface EmployeeMapper {

    //根据用户名查找一个用户
    @Select("select * from employee where username=#{username} ")
    Employee login(Employee employee);
    //保存用户
    @Insert("insert into employee values(null,#{name},#{username},#{password},#{phone},#{sex},#{idNumber},#{status},#{createTime},#{updateTime},#{createUser},#{updateUser})")
    void save(Employee employee);

    //分页查询
    List<Employee> findByName(@Param("name") String name);
    //修改数据
    void update(Employee employee);
    //根据id查找
    @Select("select * from employee where id=#{id}")
    Employee findById(Long id);
}
